Ext.define('channel.commodity.CommodityLogDetailWin',{
	_winType : 'search',
	closeAction : 'hide',
	extend : 'Ext.window.Window',
	width : 500,
	resizable : false,
	modal : true,	
	initComponent : function(){
		this.form = Ext.create('Ext.form.Panel',{
			border : false,		
			bodyPadding: 5,
			defaults : {labelAlign : 'right',anchor:'90%',xtype:'textfield'},
			items :[
				{
			        fieldLabel: '编 号',
			        name: 'id',
			        maxLenght : 15
			    },
				{
			        fieldLabel: '商品编号',
			        name: 'commodity',
			        maxLenght : 15
			    },
			    {
					fieldLabel:'渠 道',
	                xtype: 'radiogroup',
	                layout: 'column',
	                defaults: {
	                    name: 'distribute_detail',
	                    margins: '0 10 0 0'
	                },
	                items: [{
	                    inputValue: 110,
	                    boxLabel: '淘宝商城 '
	                }, {
	                    inputValue: 123,
	                    boxLabel: '淘宝医学店 '
	                }, {
	                    inputValue: 122,
	                    boxLabel: '淘宝经管店 '
	                }, {
	                    inputValue: 111,
	                    boxLabel: '拍拍商城 '
	                }, {
	                    inputValue: 123,
	                    boxLabel: '新浪商城  '
	                }, {
	                    inputValue: 120,
	                    boxLabel: '我有商城 '
	                }]
	            },
	            {
	            	fieldLabel: '错误信息',
	            	xtype:'textarea',
			        name: 'errorMessage'
	            }
			]
		});
		this.items = [this.form];
		this.callParent();
		this.on('hide',function(){this.form.form.reset();},this);
		this.on('show',function(){	
			this.form.form.reset();
			var o = this.fcmp;
			var m = o.center.getSelectionModel().getSelection();
			this.form.form.loadRecord(m[0]);
			this.form.form.findField('distribute_detail').setValue(
					m[0].get('distribute')
				);
		},this);
	}
});

